

class BinaryReader:
    def __init__(self, filepath : str):
        self.fp = open(filepath, 'rb')

    def read_n_bytes(self, n : int):
        return self.fp.read(n)

    def read_u1(self):
        return self.read_n_bytes(1)

    def read_u2(self):
        return self.read_n_bytes(2)

    def read_short(self):
        return int.from_bytes(self.read_u2(), 'big')

    def read_u4(self):
        return self.read_n_bytes(4)

    def read_int(self):
        return int.from_bytes(self.read_u4(), 'big')

    def tell(self):
        return self.fp.tell()